package com.zczy.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 第三方用户信息表
 * @TableName zczy_oauth_user
 */
@TableName(value ="zczy_oauth_user")
@Data
public class ZczyOauthUser implements Serializable {
    /**
     * 
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用户id
     */
    @TableField(value = "user_id")
    private Integer user_id;

    /**
     * (wx:微信，qq)
     */
    @TableField(value = "froms")
    private String froms;

    /**
     * 状态（1：正常；0：禁用）
     */
    @TableField(value = "status")
    private Integer status;

    /**
     * token
     */
    @TableField(value = "access_token")
    private String access_token;

    /**
     * token过期时间
     */
    @TableField(value = "expires_date")
    private String expires_date;

    /**
     * 绑定时间
     */
    @TableField(value = "create_time")
    private String create_time;

    /**
     * 第三方用户id
     */
    @TableField(value = "openid")
    private String openid;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ZczyOauthUser other = (ZczyOauthUser) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUser_id() == null ? other.getUser_id() == null : this.getUser_id().equals(other.getUser_id()))
            && (this.getFroms() == null ? other.getFroms() == null : this.getFroms().equals(other.getFroms()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getAccess_token() == null ? other.getAccess_token() == null : this.getAccess_token().equals(other.getAccess_token()))
            && (this.getExpires_date() == null ? other.getExpires_date() == null : this.getExpires_date().equals(other.getExpires_date()))
            && (this.getCreate_time() == null ? other.getCreate_time() == null : this.getCreate_time().equals(other.getCreate_time()))
            && (this.getOpenid() == null ? other.getOpenid() == null : this.getOpenid().equals(other.getOpenid()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUser_id() == null) ? 0 : getUser_id().hashCode());
        result = prime * result + ((getFroms() == null) ? 0 : getFroms().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getAccess_token() == null) ? 0 : getAccess_token().hashCode());
        result = prime * result + ((getExpires_date() == null) ? 0 : getExpires_date().hashCode());
        result = prime * result + ((getCreate_time() == null) ? 0 : getCreate_time().hashCode());
        result = prime * result + ((getOpenid() == null) ? 0 : getOpenid().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", user_id=").append(user_id);
        sb.append(", froms=").append(froms);
        sb.append(", status=").append(status);
        sb.append(", access_token=").append(access_token);
        sb.append(", expires_date=").append(expires_date);
        sb.append(", create_time=").append(create_time);
        sb.append(", openid=").append(openid);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}